home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group93c.txt
/
000008_icon-group-sender _Sun Jul 11 13:53:35 1993.msg
< prev
next >
Wrap
Internet Message Format
|
1994-02-02
|
1KB
Received: by cheltenham.cs.arizona.edu; Sun, 11 Jul 1993 12:58:27 MST
Date: Sun, 11 Jul 93 13:53:35 CDT
From: "Richard L. Goerwitz" <goer@midway.uchicago.edu>
Message-Id: <9307111853.AA17772@midway.uchicago.edu>
To: Paul_Abrahams@mts.cc.wayne.edu
Subject: Re: Sort enhancements for records and lists
Cc: icon-group@cs.arizona.edu
Status: R
Errors-To: icon-group-errors@cs.arizona.edu
>The obvious rule for sorting lists is that they are sorted by their first
>element; within equal first elements, by their second element, and so
>forth. This simple extension would provide multi-field sorting,
>something that many people have requested.
There is a function, sortf, that sorts on a requested field. I wrote
a procedure a while back that will sort on arbitrarily many fields, in
order. It's called sortff(). If, say, you want lists sorted on field
3, then (if several lists have the same field 3) on field 4, you'd say
sortff(l, 3, 4). If anyone wants me to post sortff() will do so. It
is not very long.
Full recursive sorts on all structures tend to be expensive, and only
rarely necessary (in my experience).
Paul, I'm like you in the sense that I treat the sort order for struc-
tures as undefined, even though a version or so ago the Icon Project
define a full sort order for all objects.
-Richard
goer@midway.uchicago.edu